package com.examsystem;

import com.examsystem.listener.WebSocketListener;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.config.annotation.EnableWebSocket;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;

/**
 * @author fire'ge
 */
/**
 * @author Administrator
 */
@ServletComponentScan(basePackages = "com.examsystem.listener")
@EnableWebSocket
@SpringBootApplication
@EnableAsync
@EnableScheduling
public class ExamSystemApplication {

    public static void main(String[] args) {
        SpringApplication springApplication = new SpringApplication(ExamSystemApplication.class);
        ConfigurableApplicationContext configurableApplicationContext = springApplication.run(args);
        //解决WebSocket不能注入的问题
        WebSocketListener.setApplicationContext(configurableApplicationContext);
    }

}
